3.647 \(\int \sec ^4(c+d x) (a+b \tan (c+d x))^n \, dx\)

Optimal. Leaf size=88 \[ \frac{\left (a^2+b^2\right ) (a+b \tan (c+d x))^{n+1}}{b^3 d (n+1)}-\frac{2 a (a+b \tan (c+d x))^{n+2}}{b^3 d (n+2)}+\frac{(a+b \tan (c+d x))^{n+3}}{b^3 d (n+3)} \]

[Out]

((a^2 + b^2)*(a + b*Tan[c + d*x])^(1 + n))/(b^3*d*(1 + n)) - (2*a*(a + b*Tan[c + d*x])^(2 + n))/(b^3*d*(2 + n)
) + (a + b*Tan[c + d*x])^(3 + n)/(b^3*d*(3 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.0764361, antiderivative size = 88, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3506, 697} \[ \frac{\left (a^2+b^2\right ) (a+b \tan (c+d x))^{n+1}}{b^3 d (n+1)}-\frac{2 a (a+b \tan (c+d x))^{n+2}}{b^3 d (n+2)}+\frac{(a+b \tan (c+d x))^{n+3}}{b^3 d (n+3)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4*(a + b*Tan[c + d*x])^n,x]

[Out]

((a^2 + b^2)*(a + b*Tan[c + d*x])^(1 + n))/(b^3*d*(1 + n)) - (2*a*(a + b*Tan[c + d*x])^(2 + n))/(b^3*d*(2 + n)
) + (a + b*Tan[c + d*x])^(3 + n)/(b^3*d*(3 + n))

Rule 3506

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rule 697

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rubi steps

\begin{align*} \int \sec ^4(c+d x) (a+b \tan (c+d x))^n \, dx &=\frac{\operatorname{Subst}\left (\int (a+x)^n \left (1+\frac{x^2}{b^2}\right ) \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{\left (a^2+b^2\right ) (a+x)^n}{b^2}-\frac{2 a (a+x)^{1+n}}{b^2}+\frac{(a+x)^{2+n}}{b^2}\right ) \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac{\left (a^2+b^2\right ) (a+b \tan (c+d x))^{1+n}}{b^3 d (1+n)}-\frac{2 a (a+b \tan (c+d x))^{2+n}}{b^3 d (2+n)}+\frac{(a+b \tan (c+d x))^{3+n}}{b^3 d (3+n)}\\ \end{align*}

Mathematica [A]  time = 0.240196, size = 71, normalized size = 0.81 \[ \frac{(a+b \tan (c+d x))^{n+1} \left (\frac{a^2+b^2}{n+1}+\frac{(a+b \tan (c+d x))^2}{n+3}-\frac{2 a (a+b \tan (c+d x))}{n+2}\right )}{b^3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4*(a + b*Tan[c + d*x])^n,x]

[Out]

((a + b*Tan[c + d*x])^(1 + n)*((a^2 + b^2)/(1 + n) - (2*a*(a + b*Tan[c + d*x]))/(2 + n) + (a + b*Tan[c + d*x])
^2/(3 + n)))/(b^3*d)

________________________________________________________________________________________

Maple [F]  time = 0.197, size = 0, normalized size = 0. \begin{align*} \int \left ( \sec \left ( dx+c \right ) \right ) ^{4} \left ( a+b\tan \left ( dx+c \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x)

[Out]

int(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.77677, size = 392, normalized size = 4.45 \begin{align*} \frac{{\left (2 \,{\left (2 \, a b^{2} n + a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} +{\left (a b^{2} n^{2} + a b^{2} n\right )} \cos \left (d x + c\right ) +{\left (b^{3} n^{2} + 3 \, b^{3} n + 2 \, b^{3} + 2 \,{\left (2 \, b^{3} -{\left (a^{2} b - b^{3}\right )} n\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \left (\frac{a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )}{\cos \left (d x + c\right )}\right )^{n}}{{\left (b^{3} d n^{3} + 6 \, b^{3} d n^{2} + 11 \, b^{3} d n + 6 \, b^{3} d\right )} \cos \left (d x + c\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

(2*(2*a*b^2*n + a^3 + 3*a*b^2)*cos(d*x + c)^3 + (a*b^2*n^2 + a*b^2*n)*cos(d*x + c) + (b^3*n^2 + 3*b^3*n + 2*b^
3 + 2*(2*b^3 - (a^2*b - b^3)*n)*cos(d*x + c)^2)*sin(d*x + c))*((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))
^n/((b^3*d*n^3 + 6*b^3*d*n^2 + 11*b^3*d*n + 6*b^3*d)*cos(d*x + c)^3)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*(a+b*tan(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError